﻿//-----------------------------------------------------------------------
// <copyright file="Layouts.cs" company="LMT">
//     Copyright (c) by La Minh Thuận.
// </copyright>
// <author>thuanla1985@hotmail.com</author>
//-----------------------------------------------------------------------
namespace LMT.Db.OracleClient
{
    using System;
    using System.Collections.Generic;
    using System.Data;
    using System.Data.OracleClient;

    /// <summary>
    /// Base class for all Ado Adapter.
    /// </summary>
    /// <typeparam name="T">IEntity constrait</typeparam>
    public class OracleAdapter<T> : DbAdapter<T> where T : IDbEntity, new()
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="OracleAdapter&lt;T&gt;"/> class.
        /// </summary>
        public OracleAdapter()
        {
            this.dataProvider = OracleProvider.Instance;

            if (OracleAdapter<T>.EntityParser == null)
            {
                OracleAdapter<T>.EntityParser = OracleEntity.Instance;
            }
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="OracleAdapter&lt;T&gt;"/> class.
        /// </summary>
        /// <param name="sequence">The sequence.</param>
        public OracleAdapter(string sequence) : this()
        {
            this.SequenceName = sequence;
        }

        /// <summary>
        /// Processes the limit return.
        /// </summary>
        /// <param name="maximum">The maximum.</param>
        /// <param name="generatedSql">The generated SQL.</param>
        /// <returns></returns>
        protected override string ProcessLimitReturn(int maximum, string generatedSql)
        {
            throw new NotImplementedException();
        }
    }
}